From 7ebc3862a0f55121ff0003b05f1eec29c97fefeb Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 17 Oct 2005 20:17:57 +0000 Subject: [PATCH] Tighten up types of a short handle. It's now a "real" type and not a void *. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1472 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/cetus.c | 4 ++-- gpsbabel/coto.c | 4 ++-- gpsbabel/csv_util.h | 2 +- gpsbabel/defs.h | 25 +++++++++++---------- gpsbabel/easygps.c | 4 ++-- gpsbabel/garmin.c | 5 ++--- gpsbabel/gdb.c | 6 ++--- gpsbabel/google.c | 4 ++-- gpsbabel/gpsutil.c | 4 ++-- gpsbabel/gpx.c | 4 ++-- gpsbabel/holux.c | 4 ++-- gpsbabel/html.c | 4 ++-- gpsbabel/lowranceusr.c | 4 ++-- gpsbabel/maggeo.c | 4 ++-- gpsbabel/magnav.c | 4 ++-- gpsbabel/magproto.c | 5 ++--- gpsbabel/mapopolis.c | 4 ++-- gpsbabel/mapsend.c | 4 ++-- gpsbabel/mapsource.c | 12 +++++----- gpsbabel/mkshort.c | 51 +++++++++++++++++++++--------------------- gpsbabel/nmea.c | 4 ++-- gpsbabel/overlay.c | 2 +- gpsbabel/ozi.c | 6 ++--- gpsbabel/palmdoc.c | 8 +++---- gpsbabel/pathaway.c | 4 ++-- gpsbabel/pcx.c | 8 +++---- gpsbabel/psitrex.c | 4 ++-- gpsbabel/psp.c | 4 ++-- gpsbabel/text.c | 4 ++-- gpsbabel/tiger.c | 8 +++---- gpsbabel/tmpro.c | 4 ++-- gpsbabel/tpg.c | 4 ++-- gpsbabel/tpo.c | 2 +- gpsbabel/vcf.c | 4 ++-- gpsbabel/waypt.c | 4 ++-- gpsbabel/xcsv.c | 2 +- 36 files changed, 115 insertions(+), 115 deletions(-) diff --git a/gpsbabel/cetus.c b/gpsbabel/cetus.c index 3596244fb..272037b6b 100644 --- a/gpsbabel/cetus.c +++ b/gpsbabel/cetus.c @@ -141,7 +141,7 @@ static FILE *file_out; static const char *out_fname; static struct pdb *opdb; static struct pdb_record *opdb_rec; -static void *mkshort_wr_handle; +static short_handle mkshort_wr_handle; static char *dbname = NULL; static char *appendicon = NULL; @@ -623,7 +623,7 @@ data_write(void) pdb_Write(opdb, fileno(file_out)); xfree(htable); - mkshort_del_handle(mkshort_wr_handle); + mkshort_del_handle(&mkshort_wr_handle); } diff --git a/gpsbabel/coto.c b/gpsbabel/coto.c index 9184a0c2b..1ccb4673b 100644 --- a/gpsbabel/coto.c +++ b/gpsbabel/coto.c @@ -311,7 +311,7 @@ coto_wpt_write(const waypoint *wpt) struct appinfo *ai = (struct appinfo *) opdb->appinfo; static int ct; struct pdb_record *opdb_rec; - static void *mkshort_wr_handle; + static short_handle mkshort_wr_handle; char *notes = NULL; char *shortname = NULL; char *vdata; @@ -380,7 +380,7 @@ coto_wpt_write(const waypoint *wpt) xfree(shortname); xfree(rec); - mkshort_del_handle(mkshort_wr_handle); + mkshort_del_handle(&mkshort_wr_handle); } diff --git a/gpsbabel/csv_util.h b/gpsbabel/csv_util.h index 3b5acc735..c8257726f 100644 --- a/gpsbabel/csv_util.h +++ b/gpsbabel/csv_util.h @@ -122,7 +122,7 @@ typedef struct { char * description; /* Description for help text */ char * extension; /* preferred filename extension (for wrappers)*/ - void * mkshort_handle; /* handle for mkshort() */ + short_handle mkshort_handle;/* handle for mkshort() */ ff_type type; /* format type for GUI wrappers. */ } xcsv_file_t; diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index a89ea7dd7..d5271385b 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -394,25 +394,26 @@ void track_restore(unsigned int count, queue *head_bak); * All shortname functions take a shortname handle as the first arg. * This is an opaque pointer. Callers must not fondle the contents of it. */ +typedef struct short_handle * short_handle; #ifndef DEBUG_MEM -char *mkshort (void *, const char *); +char *mkshort (short_handle, const char *); void *mkshort_new_handle(void); #else -char *MKSHORT(void *, const char *, DEBUG_PARAMS); +char *MKSHORT(short_handle, const char *, DEBUG_PARAMS); void *MKSHORT_NEW_HANDLE(DEBUG_PARAMS); #define mkshort( a, b) MKSHORT(a,b,__FILE__, __LINE__) #define mkshort_new_handle() MKSHORT_NEW_HANDLE(__FILE__,__LINE__) #endif -char *mkshort_from_wpt(void *h, const waypoint *wpt); -void mkshort_del_handle(void *h); -void setshort_length(void *, int n); -void setshort_badchars(void *, const char *); -void setshort_goodchars(void *, const char *); -void setshort_mustupper(void *, int n); -void setshort_mustuniq(void *, int n); -void setshort_whitespace_ok(void *, int n); -void setshort_repeating_whitespace_ok(void *, int n); -void setshort_defname(void *, const char *s); +char *mkshort_from_wpt(short_handle h, const waypoint *wpt); +void mkshort_del_handle(short_handle *h); +void setshort_length(short_handle, int n); +void setshort_badchars(short_handle, const char *); +void setshort_goodchars(short_handle, const char *); +void setshort_mustupper(short_handle, int n); +void setshort_mustuniq(short_handle, int n); +void setshort_whitespace_ok(short_handle, int n); +void setshort_repeating_whitespace_ok(short_handle, int n); +void setshort_defname(short_handle, const char *s); /* * Vmem flags values. diff --git a/gpsbabel/easygps.c b/gpsbabel/easygps.c index 1d4c950ae..8945210c0 100644 --- a/gpsbabel/easygps.c +++ b/gpsbabel/easygps.c @@ -24,7 +24,7 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; /* static char *deficon = NULL; */ #define MYNAME "EasyGPS" @@ -69,7 +69,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } /* diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index 81023385c..a9c50c853 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -27,7 +27,7 @@ #define MYNAME "GARMIN" static const char *portname; -static void *mkshort_handle; +static short_handle mkshort_handle; static GPS_PWay *tx_routelist; static GPS_PWay *cur_tx_routelist_entry; static GPS_PTrack *tx_tracklist; @@ -154,8 +154,7 @@ static void rw_deinit(void) { if (mkshort_handle) { - mkshort_del_handle(mkshort_handle); - mkshort_handle = NULL; + mkshort_del_handle(&mkshort_handle); } } diff --git a/gpsbabel/gdb.c b/gpsbabel/gdb.c index 27fc8dc96..4121f2b8a 100644 --- a/gpsbabel/gdb.c +++ b/gpsbabel/gdb.c @@ -82,7 +82,7 @@ static int gdb_via; /* 0 = read and write hidden points too; 1 = drop */ static int gdb_category; static route_head *gdb_hidden = NULL; -static void *gdb_short_handle; +static short_handle gdb_short_handle; #define GDB_OPT_VER "ver" #define GDB_OPT_VIA "via" @@ -1111,7 +1111,7 @@ static void gdb_reset_short_handle(void) { if (gdb_short_handle != NULL) - mkshort_del_handle(gdb_short_handle); + mkshort_del_handle(&gdb_short_handle); gdb_short_handle = mkshort_new_handle(); @@ -1650,7 +1650,7 @@ gdb_wr_deinit(void) fclose(fout); xfree(fout_name); fout_name = NULL; - mkshort_del_handle(gdb_short_handle); + mkshort_del_handle(&gdb_short_handle); } static void diff --git a/gpsbabel/google.c b/gpsbabel/google.c index dd5b09168..e5c724448 100644 --- a/gpsbabel/google.c +++ b/gpsbabel/google.c @@ -23,7 +23,7 @@ static char *encoded_points = NULL; static char *encoded_levels = NULL; static char *script = NULL; static route_head *track_head; -static void *desc_handle; +static short_handle desc_handle; static FILE *fd; @@ -247,7 +247,7 @@ static void google_rd_deinit(void) { xml_deinit(); - mkshort_del_handle(desc_handle); + mkshort_del_handle(&desc_handle); } ff_vecs_t google_vecs = { diff --git a/gpsbabel/gpsutil.c b/gpsbabel/gpsutil.c index e71ab5c77..9b108ad78 100644 --- a/gpsbabel/gpsutil.c +++ b/gpsbabel/gpsutil.c @@ -23,7 +23,7 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; #define MYNAME "GPSUTIL" @@ -50,7 +50,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 5498c0db7..4063e181f 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -46,7 +46,7 @@ static waypoint *wpt_tmp; static int cache_descr_is_html; static FILE *fd; static FILE *ofd; -static void *mkshort_handle; +static short_handle mkshort_handle; static const char *input_string = NULL; static int input_string_len = 0; @@ -1006,7 +1006,7 @@ static void gpx_wr_deinit(void) { fclose(ofd); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } void diff --git a/gpsbabel/holux.c b/gpsbabel/holux.c index e4ad7f4a3..a020a8bbe 100644 --- a/gpsbabel/holux.c +++ b/gpsbabel/holux.c @@ -34,7 +34,7 @@ History: static FILE *file_in; static unsigned char *HxWFile; -static void *mkshort_handle; +static short_handle mkshort_handle; static char fOutname[256]; #define MYNAME "Holux" @@ -70,7 +70,7 @@ wr_init(const char *fname) static void wr_deinit(void) { - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } diff --git a/gpsbabel/html.c b/gpsbabel/html.c index 9620861ca..437642b07 100644 --- a/gpsbabel/html.c +++ b/gpsbabel/html.c @@ -25,7 +25,7 @@ #include static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static char *stylesheet = NULL; static char *encrypt = NULL; @@ -57,7 +57,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/lowranceusr.c b/gpsbabel/lowranceusr.c index deb745562..8d4ff1a01 100644 --- a/gpsbabel/lowranceusr.c +++ b/gpsbabel/lowranceusr.c @@ -136,7 +136,7 @@ const lowranceusr_icon_mapping_t lowranceusr_icon_value_table[] = { static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static unsigned short waypt_out_count; static unsigned int trail_count, lowrance_route_count; @@ -256,7 +256,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } /** diff --git a/gpsbabel/maggeo.c b/gpsbabel/maggeo.c index 1746dfdd5..e536bb83b 100644 --- a/gpsbabel/maggeo.c +++ b/gpsbabel/maggeo.c @@ -28,7 +28,7 @@ static FILE *maggeofile_in; static FILE *maggeofile_out; -static void *desc_handle = NULL; +static short_handle desc_handle = NULL; static void maggeo_writemsg(const char * const buf) @@ -62,7 +62,7 @@ static void maggeo_wr_deinit(void) { maggeo_writemsg("PMGNCMD,END"); - mkshort_del_handle(desc_handle); + mkshort_del_handle(&desc_handle); fclose(maggeofile_out); } diff --git a/gpsbabel/magnav.c b/gpsbabel/magnav.c index f60f86f7b..2d0193d97 100644 --- a/gpsbabel/magnav.c +++ b/gpsbabel/magnav.c @@ -52,7 +52,7 @@ struct record { static FILE *file_in; static FILE *file_out; static const char *out_fname; -static void *mkshort_handle; +static short_handle mkshort_handle; static struct pdb *opdb; static struct pdb_record *opdb_rec; @@ -82,7 +82,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index 442d36170..bbde00246 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -38,7 +38,7 @@ static void termwrite(char *obuf, int size); static void mag_readmsg(gpsdata_type objective); static void mag_handon(void); static void mag_handoff(void); -static void *mkshort_handle = NULL; +static short_handle mkshort_handle = NULL; static char *deficon = NULL; static char *bs = NULL; static char *cmts = NULL; @@ -876,8 +876,7 @@ mag_deinit(void) fclose(magfile_in); magfile_in = NULL; if(mkshort_handle) - mkshort_del_handle(mkshort_handle); - mkshort_handle = NULL; + mkshort_del_handle(&mkshort_handle); waypt_flush(&rte_wpt_tmp); } diff --git a/gpsbabel/mapopolis.c b/gpsbabel/mapopolis.c index 584d12409..4119030ec 100644 --- a/gpsbabel/mapopolis.c +++ b/gpsbabel/mapopolis.c @@ -67,7 +67,7 @@ struct record { static FILE *file_in; static FILE *file_out; static const char *out_fname; -static void *mkshort_handle; +static short_handle mkshort_handle; struct pdb *opdb; struct pdb_record *opdb_rec; @@ -97,7 +97,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } convert_rec0(struct record0 *rec0) diff --git a/gpsbabel/mapsend.c b/gpsbabel/mapsend.c index db036ebbd..8f6f7d0fb 100644 --- a/gpsbabel/mapsend.c +++ b/gpsbabel/mapsend.c @@ -27,7 +27,7 @@ static FILE *mapsend_file_in; static FILE *mapsend_file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static int route_wp_count; static int mapsend_infile_version; @@ -101,7 +101,7 @@ static void mapsend_wr_deinit(void) { fclose(mapsend_file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/mapsource.c b/gpsbabel/mapsource.c index 3fc38cad8..88f849502 100644 --- a/gpsbabel/mapsource.c +++ b/gpsbabel/mapsource.c @@ -31,7 +31,7 @@ static FILE *mps_file_in; static FILE *mps_file_out; static FILE *mps_file_temp; -static void *mkshort_handle; +static short_handle mkshort_handle; static int mps_ver_in = 0; static int mps_ver_out = 0; @@ -45,11 +45,11 @@ static const waypoint *prevRouteWpt; /* Private queues of written out waypoints */ static queue written_wpt_head; static queue written_route_wpt_head; -static void *written_wpt_mkshort_handle; +static short_handle written_wpt_mkshort_handle; /* Private queue of read in waypoints assumed to be used only for routes */ static queue read_route_wpt_head; -static void *read_route_wpt_mkshort_handle; +static short_handle read_route_wpt_mkshort_handle; #define MPSDEFAULTWPTCLASS 0 #define MPSHIDDENROUTEWPTCLASS 8 @@ -287,7 +287,7 @@ mps_rd_deinit(void) { fclose(mps_file_in); if ( read_route_wpt_mkshort_handle ) { - mkshort_del_handle( read_route_wpt_mkshort_handle ); + mkshort_del_handle( &read_route_wpt_mkshort_handle ); } /* flush the "private" queue of waypoints read for routes */ mps_wpt_q_deinit(&read_route_wpt_head); @@ -339,7 +339,7 @@ mps_wr_deinit(void) } if ( written_wpt_mkshort_handle ) { - mkshort_del_handle( written_wpt_mkshort_handle ); + mkshort_del_handle( &written_wpt_mkshort_handle ); } /* flush the "private" queue of waypoints written */ mps_wpt_q_deinit(&written_wpt_head); @@ -2165,7 +2165,7 @@ mps_write(void) } else mps_mapsetname_w(mps_file_out, mps_ver_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 2ab7e220c..a035062dc 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -149,12 +149,12 @@ mkshort_add_to_list(mkshort_handle *h, char *name) } void -mkshort_del_handle(void *h) +mkshort_del_handle(short_handle *h) { - mkshort_handle *hdr = h; + mkshort_handle *hdr = (mkshort_handle*) *h; int i; - if (!hdr) + if (!h || !hdr) return; for (i = 0; i < PRIME; i++) { @@ -172,13 +172,14 @@ mkshort_del_handle(void *h) xfree(s); } } - setshort_badchars(h, NULL); - setshort_goodchars(h, NULL); + setshort_badchars(*h, NULL); + setshort_goodchars(*h, NULL); if (hdr->defname) { xfree(hdr->defname); } xfree(hdr); + *h = NULL; } /* @@ -218,9 +219,9 @@ delete_last_vowel(int start, char *istring, int *replaced) * strings returned by mkshort(). 0 resets to default. */ void -setshort_length(void *h, int l) +setshort_length(short_handle h, int l) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; if (l == 0) { hdl->target_len = DEFAULT_TARGET_LEN; } else { @@ -233,9 +234,9 @@ setshort_length(void *h, int l) */ void -setshort_whitespace_ok(void *h, int l) +setshort_whitespace_ok(short_handle h, int l) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; hdl->whitespaceok = l; } @@ -245,9 +246,9 @@ setshort_whitespace_ok(void *h, int l) */ void -setshort_repeating_whitespace_ok(void *h, int l) +setshort_repeating_whitespace_ok(short_handle h, int l) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; hdl->repeating_whitespaceok = l; } @@ -256,9 +257,9 @@ setshort_repeating_whitespace_ok(void *h, int l) * becuase it was filtered by charsets or null or whatever. */ void -setshort_defname(void *h, const char *s) +setshort_defname(short_handle h, const char *s) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; if (s == NULL) { fatal("setshort_defname called without a valid name."); } @@ -273,9 +274,9 @@ setshort_defname(void *h, const char *s) * resets to default. */ void -setshort_badchars(void *h, const char *s) +setshort_badchars(short_handle h, const char *s) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; if ((hdl->badchars != NULL) && (hdl->badchars != DEFAULT_BADCHARS)) xfree(hdl->badchars); @@ -291,9 +292,9 @@ setshort_badchars(void *h, const char *s) * in generated names. */ void -setshort_goodchars(void *h, const char *s) +setshort_goodchars(short_handle h, const char *s) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; if (hdl->goodchars != NULL) xfree(hdl->goodchars); @@ -307,9 +308,9 @@ setshort_goodchars(void *h, const char *s) * Call with i non-zero if generated names must be uppercase only. */ void -setshort_mustupper(void *h, int i) +setshort_mustupper(short_handle h, int i) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; hdl->mustupper = i; } @@ -319,17 +320,17 @@ setshort_mustupper(void *h, int i) * (By default, they are.) */ void -setshort_mustuniq(void *h, int i) +setshort_mustuniq(short_handle h, int i) { - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; hdl->must_uniq = i; } char * #ifdef DEBUG_MEM -MKSHORT(void *h, const char *istring, DEBUG_PARAMS ) +MKSHORT(short_handle h, const char *istring, DEBUG_PARAMS ) #else -mkshort(void *h, const char *istring) +mkshort(short_handle h, const char *istring) #endif { char *ostring = xxstrdup(istring, file, line); @@ -338,7 +339,7 @@ mkshort(void *h, const char *istring) char *cp; char *np; int i, l, nlen, replaced; - mkshort_handle *hdl = h; + mkshort_handle *hdl = (mkshort_handle *) h; /* * Whack leading "[Tt]he", @@ -471,7 +472,7 @@ mkshort(void *h, const char *istring) * the code that considers the alternate sources. */ char * -mkshort_from_wpt(void *h, const waypoint *wpt) +mkshort_from_wpt(short_handle h, const waypoint *wpt) { /* This probably came from a Groundspeak Pocket Query * so use the 'cache name' instead of the description field diff --git a/gpsbabel/nmea.c b/gpsbabel/nmea.c index 9393461b5..ac8229649 100644 --- a/gpsbabel/nmea.c +++ b/gpsbabel/nmea.c @@ -119,7 +119,7 @@ typedef enum { static FILE *file_in; static FILE *file_out; static route_head *trk_head; -static void *mkshort_handle; +static short_handle mkshort_handle; static preferred_posn_type posn_type; static time_t creation_time; static waypoint * curr_waypt =NULL; @@ -183,7 +183,7 @@ static void nmea_wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/overlay.c b/gpsbabel/overlay.c index 4f668e589..c462077b4 100644 --- a/gpsbabel/overlay.c +++ b/gpsbabel/overlay.c @@ -28,7 +28,7 @@ #include "defs.h" #include "grtcirc.h" -static void *mkshort_handle; +static short_handle mkshort_handle; #define MYNAME "overlay" #define PARAMETER_FILE "overlay.def" diff --git a/gpsbabel/ozi.c b/gpsbabel/ozi.c index 2de189f10..0377f899a 100644 --- a/gpsbabel/ozi.c +++ b/gpsbabel/ozi.c @@ -32,7 +32,7 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static route_head *trk_head; static route_head *rte_head; @@ -267,7 +267,7 @@ rd_deinit(void) { fclose(file_in); file_in = NULL; - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void @@ -312,7 +312,7 @@ wr_deinit(void) file_out = NULL; ozi_ofname = NULL; - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/palmdoc.c b/gpsbabel/palmdoc.c index 5e839e2e8..4d731f06b 100644 --- a/gpsbabel/palmdoc.c +++ b/gpsbabel/palmdoc.c @@ -29,8 +29,8 @@ #include "coldsync/pdb.h" static FILE *file_out; -static void *mkshort_handle; -static void *mkshort_bookmark_handle; +static short_handle mkshort_handle; +static short_handle mkshort_bookmark_handle; static const char *out_fname; static struct pdb *opdb; static struct pdb_record *opdb_rec; @@ -400,8 +400,8 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); - mkshort_del_handle(mkshort_bookmark_handle); + mkshort_del_handle(&mkshort_handle); + mkshort_del_handle(&mkshort_bookmark_handle); if ( dbname ) { xfree(dbname); diff --git a/gpsbabel/pathaway.c b/gpsbabel/pathaway.c index 3693b206c..0f9f559cb 100644 --- a/gpsbabel/pathaway.c +++ b/gpsbabel/pathaway.c @@ -41,7 +41,7 @@ static FILE *fd_in, *fd_out; static struct pdb *pdb_in, *pdb_out; static char *fname_in, *fname_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static gpsdata_type ppdb_type; static unsigned char german_release = 0; @@ -522,7 +522,7 @@ static void ppdb_wr_init(const char *fname) static void ppdb_wr_deinit(void) { - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); fclose(fd_out); str_pool_deinit(); xfree(fname_out); diff --git a/gpsbabel/pcx.c b/gpsbabel/pcx.c index 33532d8be..1c87a26a8 100644 --- a/gpsbabel/pcx.c +++ b/gpsbabel/pcx.c @@ -25,8 +25,8 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; -static void *mkshort_handle2; /* for track and route names */ +static short_handle mkshort_handle; +static short_handle mkshort_handle2; /* for track and route names */ static char *deficon = NULL; static int read_as_degrees; static int route_ctr; @@ -64,8 +64,8 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); - mkshort_del_handle(mkshort_handle2); + mkshort_del_handle(&mkshort_handle); + mkshort_del_handle(&mkshort_handle2); } static void diff --git a/gpsbabel/psitrex.c b/gpsbabel/psitrex.c index 6f0a8d6b6..79bc631bf 100755 --- a/gpsbabel/psitrex.c +++ b/gpsbabel/psitrex.c @@ -43,7 +43,7 @@ typedef struct psit_icon_mapping { static FILE *psit_file_in; static FILE *psit_file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; /* 2 = not written any tracks out 1 = change of track to write out track header @@ -780,7 +780,7 @@ psit_write(void) track_disp_all(psit_trackhdr_w_wrapper, psit_noop, psit_trackdatapoint_w_wrapper); } - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } diff --git a/gpsbabel/psp.c b/gpsbabel/psp.c index dc66048f8..29973af1a 100644 --- a/gpsbabel/psp.c +++ b/gpsbabel/psp.c @@ -31,7 +31,7 @@ static FILE *psp_file_in; static FILE *psp_file_out; -static FILE *mkshort_handle; +static short_handle mkshort_handle; static int psp_fread(void *buff, size_t size, size_t members, FILE * fp) @@ -196,7 +196,7 @@ psp_wr_init(const char *fname) static void psp_wr_deinit(void) { - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); fclose(psp_file_out); } diff --git a/gpsbabel/text.c b/gpsbabel/text.c index 192f35065..e8f0b022a 100644 --- a/gpsbabel/text.c +++ b/gpsbabel/text.c @@ -25,7 +25,7 @@ #include static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static char *suppresssep = NULL; static char *encrypt = NULL; @@ -58,7 +58,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void diff --git a/gpsbabel/tiger.c b/gpsbabel/tiger.c index f6d2caa9f..52c09157e 100644 --- a/gpsbabel/tiger.c +++ b/gpsbabel/tiger.c @@ -24,8 +24,8 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; -static void *mkshort_whandle; +static short_handle mkshort_handle; +static short_handle mkshort_whandle; #define MYNAME "GPSUTIL" @@ -108,7 +108,7 @@ static void rd_deinit(void) { fclose(file_in); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } static void @@ -274,7 +274,7 @@ data_write(void) #endif } - mkshort_del_handle(mkshort_whandle); + mkshort_del_handle(&mkshort_whandle); } diff --git a/gpsbabel/tmpro.c b/gpsbabel/tmpro.c index 0bedd4245..d1bb33fe7 100644 --- a/gpsbabel/tmpro.c +++ b/gpsbabel/tmpro.c @@ -40,7 +40,7 @@ static FILE *file_in; static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static void rd_init(const char *fname) @@ -243,7 +243,7 @@ data_write(void) fprintf(file_out, "Group\tsID\tsDescription\tfLat\tfLong\tfEasting\tfNorthing\tfAlt\tiColour\tiSymbol\tsHyperLink\n"); waypt_disp_all(tmpro_waypt_pr); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } ff_vecs_t tmpro_vecs = { diff --git a/gpsbabel/tpg.c b/gpsbabel/tpg.c index 1c2022d42..fd7b2c906 100644 --- a/gpsbabel/tpg.c +++ b/gpsbabel/tpg.c @@ -32,7 +32,7 @@ static FILE *tpg_file_in; static FILE *tpg_file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static char *tpg_datum_opt; static int tpg_datum_idx; @@ -127,7 +127,7 @@ tpg_wr_init(const char *fname) static void tpg_wr_deinit(void) { - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); fclose(tpg_file_out); } diff --git a/gpsbabel/tpo.c b/gpsbabel/tpo.c index 9864c5024..5866f6d04 100644 --- a/gpsbabel/tpo.c +++ b/gpsbabel/tpo.c @@ -41,7 +41,7 @@ arglist_t tpo_args[] = { static FILE *tpo_file_in; static FILE *tpo_file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static double output_track_lon_scale; static double output_track_lat_scale; diff --git a/gpsbabel/vcf.c b/gpsbabel/vcf.c index 00ad9d525..51eb773d0 100644 --- a/gpsbabel/vcf.c +++ b/gpsbabel/vcf.c @@ -24,7 +24,7 @@ #include static FILE *file_out; -static void *mkshort_handle; +static short_handle mkshort_handle; static char *encrypt = NULL; @@ -48,7 +48,7 @@ static void wr_deinit(void) { fclose(file_out); - mkshort_del_handle(mkshort_handle); + mkshort_del_handle(&mkshort_handle); } /* diff --git a/gpsbabel/waypt.c b/gpsbabel/waypt.c index c01defd1c..bf5a30dc5 100644 --- a/gpsbabel/waypt.c +++ b/gpsbabel/waypt.c @@ -25,7 +25,7 @@ queue waypt_head; static unsigned int waypt_ct; -static void *mkshort_handle; +static short_handle mkshort_handle; void waypt_init(void) @@ -310,7 +310,7 @@ void waypt_flush_all() { if ( mkshort_handle ) { - mkshort_del_handle( mkshort_handle ); + mkshort_del_handle( &mkshort_handle ); } waypt_flush(&waypt_head); } diff --git a/gpsbabel/xcsv.c b/gpsbabel/xcsv.c index c8ac96721..cfcd27d5c 100644 --- a/gpsbabel/xcsv.c +++ b/gpsbabel/xcsv.c @@ -159,7 +159,7 @@ xcsv_destroy_style(void) xfree(xcsv_file.extension); if (xcsv_file.mkshort_handle) - mkshort_del_handle(xcsv_file.mkshort_handle); + mkshort_del_handle(&xcsv_file.mkshort_handle); /* return everything to zeros */ internal = xcsv_file.is_internal; -- 2.30.2